package cn.lopr.im.socketserver.client;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;

/**
 * @author shuangyang7
 * @date 2020/12/19 10:51
 */
public class IMSocketClient extends WebSocketClient {

    public IMSocketClient(URI serverUri) {
        super(serverUri, new Draft_6455());
    }

    public void onOpen(ServerHandshake handshakedata) {
        System.out.println("IMSocketClient.onOpen" + handshakedata);
    }

    public void onMessage(String message) {
        System.out.println("IMSocketClient.onMessage" + message);
    }

    public void onClose(int code, String reason, boolean remote) {
        System.out.println("IMSocketClient.onClose");
    }

    public void onError(Exception ex) {

    }
}
